﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.Biz
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("fnd_user_security_tab", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class fnd_user_security : Entity<fnd_user_security>,Ifnd_user_security
    {
        #region 属性
 
        private String _identity;

        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(40)/UPPERCASE^PROMPT=Identity^</summary>
        [DisplayName("Identity")]
        [Description("FLAGS=KMI-L^DATATYPE=STRING(40)/UPPERCASE^PROMPT=Identity^")]
        [DataObjectField(false, false, false, 40)]
        [BindColumn(1, "identity",  null, "varchar(40)", 0, 0, false)]

        public virtual String identity

        {
            get { return _identity; }
            set { if (OnPropertyChanging(__.identity, value)) { _identity = value; OnPropertyChanged(__.identity); } }
        }

 
        private String _pres_object;

        /// <summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
        [DisplayName("Pres_Object")]
        [Description("FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(2, "pres_object",  null, "varchar(50)", 0, 0, false)]

        public virtual String pres_object

        {
            get { return _pres_object; }
            set { if (OnPropertyChanging(__.pres_object, value)) { _pres_object = value; OnPropertyChanged(__.pres_object); } }
        }

 
        private String _sec_object;

        /// <summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
        [DisplayName("Sec_Object")]
        [Description("FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(3, "sec_object",  null, "varchar(50)", 0, 0, false)]

        public virtual String sec_object

        {
            get { return _sec_object; }
            set { if (OnPropertyChanging(__.sec_object, value)) { _sec_object = value; OnPropertyChanged(__.sec_object); } }
        }

        private String _role_id;

        /// <summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
        [DisplayName("Role_id")]
        [Description("FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Role id^")]
        [DataObjectField(false, false, false, 50)]
        [BindColumn(8, "role_id", null, "varchar(50)", 0, 0, false)]

        public virtual String role_id
        {
            get { return _role_id; }
            set { if (OnPropertyChanging(__.role_id, value)) { _role_id = value; OnPropertyChanged(__.role_id); } }
        }
 
        private String _sec_object_type;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
        [DisplayName("Object_Type")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(4, "sec_object_type",  null, "varchar(50)", 0, 0, false)]

        public virtual String sec_object_type

        {
            get { return _sec_object_type; }
            set { if (OnPropertyChanging(__.sec_object_type, value)) { _sec_object_type = value; OnPropertyChanged(__.sec_object_type); } }
        }

 
        private String _sub_object_type;

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
        [DisplayName("Object_Type1")]
        [Description("FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^")]
        [DataObjectField(false, false, true, 50)]
        [BindColumn(5, "sub_object_type",  null, "varchar(50)", 0, 0, false)]

        public virtual String sub_object_type

        {
            get { return _sub_object_type; }
            set { if (OnPropertyChanging(__.sub_object_type, value)) { _sub_object_type = value; OnPropertyChanged(__.sub_object_type); } }
        }

 
        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn(6, "rowid",  null, "varchar(50)", 0, 0, false)]

        public virtual String rowid

        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }


        private DateTime? _objversion;

        /// <summary></summary>
        [DisplayName("Objversion")]
        [Description("")]
        [DataObjectField(false, false, true, 24)]
        [BindColumn(7, "rowversion",  null, "datetime", 0, 0, false)]

        public virtual DateTime? rowversion

        {
            get { return _objversion; }
            set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        }
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.identity : return _identity;
                    case __.pres_object : return _pres_object;
                    case __.sec_object : return _sec_object;
                    case __.sec_object_type : return _sec_object_type;
                    case __.sub_object_type : return _sub_object_type;
                    case __.objid : return _objid;
                    case __.role_id: return _role_id;
                    case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.identity : 
                        if(value != null)
                            _identity = Convert.ToString(value);
                        else
                            _identity = null;
                    break;
                    case __.pres_object : 
                        if(value != null)
                            _pres_object = Convert.ToString(value);
                        else
                            _pres_object = null;
                    break;
                    case __.sec_object : 
                        if(value != null)
                            _sec_object = Convert.ToString(value);
                        else
                            _sec_object = null;
                    break;
                    case __.role_id:
                    if (value != null)
                        _role_id = Convert.ToString(value);
                    else
                        _role_id = null;
                    break;
                    case __.sec_object_type : 
                        if(value != null)
                            _sec_object_type = Convert.ToString(value);
                        else
                            _sec_object_type = null;
                    break;
                    case __.sub_object_type : 
                        if(value != null)
                            _sub_object_type = Convert.ToString(value);
                        else
                            _sub_object_type = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    case __.objversion : 
                        if(value != null)
                            _objversion = Convert.ToDateTime(value);
                        else
                            _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(40)/UPPERCASE^PROMPT=Identity^</summary>
            public static readonly Field identity = FindByName(__.identity);

            ///<summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
            public static readonly Field pres_object = FindByName(__.pres_object);

            ///<summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
            public static readonly Field sec_object = FindByName(__.sec_object);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
            public static readonly Field sec_object_type = FindByName(__.sec_object_type);
            public static readonly Field role_id = FindByName(__.role_id);

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
            public static readonly Field sub_object_type = FindByName(__.sub_object_type);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMI-L^DATATYPE=STRING(40)/UPPERCASE^PROMPT=Identity^</summary>
            public const String identity = "identity";

            ///<summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>
            public const String pres_object = "pres_object";

            ///<summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>
            public const String sec_object = "sec_object";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>
            public const String sec_object_type = "sec_object_type";

            ///<summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>
            public const String sub_object_type = "sub_object_type";

            public const String role_id = "role_id";
            ///<summary></summary>
            public const String objid = "rowid";

            ///<summary></summary>
            public const String objversion = "rowversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Ifnd_user_security
    {
       #region 属性
        /// <summary>FLAGS=KMI-L^DATATYPE=STRING(40)/UPPERCASE^PROMPT=Identity^</summary>

        String identity { get; set; }


        /// <summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Pres Object^</summary>

        String pres_object { get; set; }


        /// <summary>FLAGS=KMI--^DATATYPE=STRING(50)^PROMPT=Sec Object^</summary>

        String sec_object { get; set; }
        String role_id { get; set; }

        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sec Object Type^</summary>

        String sec_object_type { get; set; }


        /// <summary>FLAGS=A-IUL^DATATYPE=STRING(50)^PROMPT=Sub Object Type^</summary>

        String sub_object_type { get; set; }


        /// <summary></summary>

        String rowid { get; set; }


        /// <summary></summary>

        DateTime? rowversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}